package com.ubs.training.server.dao.model;

import org.hibernate.annotations.GenericGenerator;

import org.hibernate.annotations.Parameter;
import javax.persistence.*;

/**
 * Created with IntelliJ IDEA.
 * User: xubuntu
 * Date: 8/21/12
 * Time: 3:20 AM
 * To change this template use File | Settings | File Templates.
 */
@GenericGenerator(name = "CMSTR_SEQ", strategy = "sequence",
        parameters = {@Parameter(name="sequence", value="cmstr_seq")})
@Entity(name="Contact_type")
public class ContactType {
    @GeneratedValue(generator = "CMSTR_SEQ")
    @Id
    @Column(name="id")
    private int id;
    @Column(name = "ctype", length = 65536)
    private String ctype;

    public String getCtype() {
        return ctype;
    }

    @Override
    public String toString() {
        return "ContactType{" +
                "id=" + id +
                ", ctype='" + ctype + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof ContactType)) return false;

        ContactType that = (ContactType) o;

        if (id != that.id) return false;
        if (ctype != null ? !ctype.equals(that.ctype) : that.ctype != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (ctype != null ? ctype.hashCode() : 0);
        return result;
    }

    public void setCtype(String ctype) {
        this.ctype = ctype;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

}
